package com.ruoyi.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.manage.domain.SysMechanism;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 满杯百香果🍎
 */
@Mapper
public interface MechanismManageMapper extends BaseMapper<SysMechanism> {

    List<SysMechanism> getList();

//    List<SysMechanism> getUnderMechanismList(@Param("id") Long id);

    List<SysMechanism> getChildrenByParentId(@Param("id") Long id);

    List<SysMechanism> getListByAuth(@Param("username") String username);

    SysMechanism getOne(@Param("username") String username);

    List<SysMechanism> getListByParam(SysMechanism sysMechanism);

    List<SysMechanism> getOneByMechanismCodeAndMechanismName(@Param("mechanismCode") String mechanismCode,
                                                             @Param("mechanismName") String mechanismName,
                                                             @Param("levelId") Long levelId,
                                                             @Param("id") Long id);

    Integer hasChildren(Long id);

    Integer addMechanism(SysMechanism sysMechanism);

    SysMechanism getMechanismByName(String parentMechanismName);
}
